package com.zzjson.crud.rowmapper;

import com.zzjson.crud.bean.Employee;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2019 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : com.zzjson.crud.rowmapper</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2019年07月09日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class EmployeeRowMapper implements RowMapper {
	@Override
	public Object mapRow(ResultSet resultSet, int i) throws SQLException {
		Employee employee = new Employee();
		employee.setEmpId(resultSet.getInt("emp_id"));
		employee.setEmpName(resultSet.getString("emp_name"));
		employee.setGender(resultSet.getString("gender"));
		employee.setEmail(resultSet.getString("email"));

		return employee;
	}
}
